//
//  SearchField.m
//  KuaiTu
//
//  Created by 江伟 on 2018/10/29.
//  Copyright © 2018年 WeiJiang. All rights reserved.
//

#import "SearchField.h"

@implementation SearchField

//override func leftViewRect(forBounds bounds: CGRect) -> CGRect {
//    var rect = super.leftViewRect(forBounds: bounds)
//    rect.origin.x = 16 // 要往右偏多少根据自己需求，改变这个数字就好
//    return rect
//}

- (CGRect)leftViewRectForBounds:(CGRect)bounds {
    CGRect rect = [super leftViewRectForBounds:bounds];
    rect.origin.x = 10;
    return rect;
}

- (CGRect)textRectForBounds:(CGRect)bounds {
    CGRect rect = [super textRectForBounds:bounds];
    rect.origin.x = 30;
    return rect;
}

- (CGRect)editingRectForBounds:(CGRect)bounds {
    CGRect rect = [super editingRectForBounds:bounds];
    rect.origin.x = 30;
    return rect;
}

@end
